package com.itheima.springboottilasmanager.survice;

import com.itheima.springboottilasmanager.pojo.domain.Clazz;
import com.itheima.springboottilasmanager.pojo.domain.PageResult;
import com.itheima.springboottilasmanager.pojo.vo.queryString;

import java.util.List;

public interface ClazzSurvice {
    boolean addClazz(Clazz clazz);
    PageResult<Clazz> findall(queryString querystring);

    //    public PageResult<Clazz> findall(queryString querystring) {
    //
    //      Page<Clazz> page =  Page.of(querystring.getPage(),querystring.getPageSize());
    //        LambdaQueryWrapper<Clazz> wrapper = new LambdaQueryWrapper<Clazz>()
    //                .like(querystring.getName() != null, Clazz::getName, querystring.getName());
    ////                .between(querystring.getBegin()!=null,Clazz::getBeginDate, querystring.getBegin(), querystring.getEnd());
    //
    //        page = page(page,wrapper);
    //        List<Clazz> Clazzlist = page.getRecords();
    //        if (CollectionUtil.isNotEmpty(Clazzlist)) {
    //          List<Integer> Clazzids = Clazzlist.stream().map(Clazz::getId).toList();
    //          List<Emp> empList = empMapper.selectBatchIds(Clazzids);
    //          if (CollectionUtil.isNotEmpty(empList)){
    //              Clazzlist.forEach(clazz->
    //                      {empList.stream().filter(emp->emp.getId().equals(clazz.getMasterId())).findFirst().ifPresent(emp->clazz.setMasterName(emp.getName()));
    //                      clazz.panduan();
    //                      }
    //              );
    //          }
    //
    //         }
    //    return new PageResult<>(page.getTotal(),Clazzlist);}


    boolean deleteClazz(Integer id);
    boolean updateClazz(Clazz list);
    Clazz selectById(Integer id);

   List<Clazz> selectAll();
}

